#!/bin/bash
#
DOCROOT=`grep -Po '^chdir = \K.*' /etc/php-fpm.d/www.conf 2>/dev/null`
if [ -z ${DOCROOT} ];then
	DOCROOT="/usr/local/emhttp"
fi

# Copy config files to ram file system.
${DOCROOT}/plugins/unassigned.devices/scripts/copy_config.sh

# Trigger a hot plug event.
/usr/bin/touch /tmp/unassigned.devices/hotplug_event

logger "Mounting 'Auto Mount' Devices..." -t"unassigned.devices"

# Automount disks and iso shares.
${DOCROOT}/plugins/unassigned.devices/scripts/rc.unassigned mount autodevices &>/dev/null

# Clear that array is shutting down
rm -rf /tmp/unassigned.devices/shut_down
